import sys, os

place = os.path.join(os.path.dirname(__file__), "./dist")
if place not in sys.path:
    sys.path.append(place)


import bottle
from beaker.middleware import SessionMiddleware

session_conf = {
    'session.type': 'ext:google',
    'session.cookie_expires': 60*60*24,
    'session.auto': True,
    'session.key': 'nipple'
}

from app.config import app as rootapp


#root mount
#import gae_mini_profiler.profiler

app = SessionMiddleware(rootapp, session_conf)
#app = gae_mini_profiler.profiler.ProfilerWSGIMiddleware(app)

bottle.run(app=app, server='gae', debug=True) #Comment once run tests

